package org.spring.springboot.MqComsumer;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Slf4j
@Component
public class X_Q {

  @RabbitListener(queues = "LJH")
  public void process(Message message, Channel channel) throws IOException {

    channel.basicAck(message.getMessageProperties().getDeliveryTag(), true);
    log.info("receive: [{}]", new String(message.getBody()));
  }
}
